package com.cmc6.user.mapper;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cmc6.user.model.dto.UserPageDTO;
import com.cmc6.user.model.vo.UserAnalysisUserNumberVO;
import com.cmc6.user.model.vo.UserCenterBaseInfoVO;
import com.cmc6.user.model.vo.UserPageVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {

    // 分页排序查询：用户信息
    List<UserPageVO> myPage(Page<UserPageVO> page, @Param("dto") UserPageDTO dto);

    // 检查 邮箱/手机号 是否存在
    int checkEmailOrPhoneExist(@Param("email") String email, @Param("userId") Long userId, @Param("phone") String phone);

    // 统计用户数
    List<UserAnalysisUserNumberVO> analysisUserNumber(@Param("timeList") List<DateTime> timeList,
        @Param("format") String format);

    // 用户基本信息
    UserCenterBaseInfoVO baseInfo(@Param("userId") Long userId);

}
